package com.scalar.forecast.projectSetup.actionCommands;

import com.scalar.forecast.actionCommands.ActionCommand;
import com.scalar.forecast.projectSetup.forms.ProjectSearchForm;
import com.scalar.forecast.projectSetup.ProjectSearch;
import com.scalar.forecast.commons.SessionKeys;

import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * Processes the request for displaying the Project Search Screen
 *
 * Created by Veeru. 
 * Date: Feb 10, 2005
 * Time: 6:49:07 PM 
 */

public class ProjectListCommand extends ActionCommand {

    public ActionForward execute( ActionMapping mapping,
                                      ActionForm form,
                                      HttpServletRequest request,
                                      HttpServletResponse response ) {

        ActionForward actionForward = mapping.findForward( "projectSearch" );
        ProjectSearchForm projectSearchForm = (ProjectSearchForm)form;
        projectSearchForm.setProjectSearch( new ProjectSearch() );
        request.setAttribute( SessionKeys.ERROR_MESSAGES, request.getAttribute( SessionKeys.PREVIOUS_ERRORS ) );
        request.setAttribute("showList","false");
        return actionForward;
    }
}

